package net.xiduth.game.npc.combat.impl;

import net.xiduth.game.Animation;
import net.xiduth.game.Entity;
import net.xiduth.game.Graphics;
import net.xiduth.game.World;
import net.xiduth.game.npc.NPC;
import net.xiduth.game.npc.combat.CombatScript;
import net.xiduth.game.npc.combat.NPCCombatDefinitions;
import net.xiduth.utils.Utils;

/**
 * 
 * @author Jae <jae@xiduth.com>
 * 
 * Last modified: <Oct 22, 2013>
 *
 */
public class SaggittareCombat extends CombatScript {
	
	@Override 
	public Object[] getKeys() {
		return new Object[] { 9753 };
	}
	
	@Override
	public int attack(final NPC npc, final Entity target) {
		
		final NPCCombatDefinitions defs = npc.getCombatDefinitions();
		
		npc.setNextAnimation(new Animation(1074));
		npc.setNextGraphics(new Graphics(249, 0, 100));
		World.sendProjectile(npc, target, 249, 41, 16, 31, 35, 16, 0);
		World.sendProjectile(npc, target, 249, 41, 16, 25, 35, 21, 0);
		World.sendProjectile(npc, target, 2699, 40, 40, 50, 50, 0, 0);
		delayHit(npc, 14, target, getRangeHit(npc, Utils.random(300)));
		delayHit(npc, 14, target, getRangeHit(npc, Utils.random(300)));
		delayHit(npc, 14, target, getRangeHit(npc, Utils.random(300)));
		
		return defs.getAttackDelay();
	}

}
